[Unit]
Description=ZooKeeper Service
Requires=network.target
After=network.target

[Service]
Type=forking
ExecStart={{ zoo_path }}/zookeeper/bin/zkServer.sh start {{ zoo_path }}/zookeeper/conf/zoo.cfg
ExecStop={{ zoo_path }}/zookeeper/bin/zkServer.sh stop {{ zoo_path }}/zookeeper/conf/zoo.cfg
ExecReload={{ zoo_path }}/zookeeper/bin/zkServer.sh restart {{ zoo_path }}/zookeeper/conf/zoo.cfg
WorkingDirectory={{ zoo_path }}/zookeeper/var
User={{ zoo_arg.user }}
LimitNOFILE={{ zoo_arg.ulimit_nofile }}
LimitNPROC={{ zoo_arg.ulimit_nproc }}
LimitCORE=infinity
LimitMEMLOCK=infinity
KillMode=control-group
Environment=SYSTEMD_KILLMODE_WARNING=true
Restart=on-failure
RestartSec=30s

[Install]
WantedBy=default.target
